public class PLEventQueueAntiFreeze {
	private volatile boolean mStop = false;
	
	public PLEventQueueAntiFreeze() {}

	public void Loop() {
		PLTempEventQueue queue = new PLTempEventQueue(); 
		queue.Init();

		PLDebug.Warn("Begin Loop");
			
		mStop = false;	
		int count = 0;
		while (!mStop) {
			++ count;
			queue.DispatchNextEvent();			
			if (count % 500 == 0) {
				PLDebug.Warn("Stuck! %d : %b", count, mStop);
			}
		}
		PLDebug.Warn("End Loop!");
		queue.Shutdown();
	}

	public void Stop() {
		mStop = true;
		PLDebug.Warn("Stop!");
		
	}
}
